<%-- 
  - Author: Asna Khader
  - Date: 02-Jan-2012
  - Copyright Notice: TRAKHEES
  - Description: show.jsp
 --%>
<%@ include file="/WEB-INF/view/include.jsp"%>
<div class="t_tmiddle-right">
    
<form:form modelAttribute="FinanceServicesInfo" name="FinanceServicesFrm"  id="FinanceServicesFrm"  method="POST" enctype="multipart/form-data" class="t_form">
			<spring:hasBindErrors
						name="FinanceServicesInfo">
							<script type="text/javascript">
								$(document).ready(
										function() {
											jAlert('error', '<li><form:errors path="*" delimiter="<li>"/>',
													'<spring:message code="label.errormessage" />');
										});
					</script>
		    </spring:hasBindErrors>		
		    
         <div class="t_search_heading"><spring:message code="label.fin_services" /></div>
		

      	<c:choose>
		<c:when	test='${FinanceServicesInfo.message == "SUCCESS"}'>
			  <label style="color: blue;"><spring:message code="label.fin_success" /></label>
		</c:when>
		<c:otherwise>
			<label></label>
		</c:otherwise>
		</c:choose>
	     <table height="100%" border="0" >
	     	<tr >
		     	<td>
		     		 <form:label path="stepCode"><spring:message code="label.fin_sel_step" /></form:label>
		     	</td>
		     	<td>
		     		 <form:select path="stepCode" onchange="submitForm();" cssClass="menu_list_single" cssStyle="menu_list_single">
	        			<form:option value=" " label=" " />
	                    <form:option value="0" label=" Visa Outside Country" />
	                    <form:option value="1" label=" Visa Inside Country" />
	                    <form:option value="2" label="Internal Transfer" />
	                    <form:option value="3" label="Transfer Sponsorship" />
	                     <form:option value="4" label="Entry Permit Renewal" />
	                    <form:option value="5" label="Entry Permit Cancellation" />
	       			</form:select>
		     	</td>
	     	</tr>
	     	 <tr >
		     	<td>
		     		  <label><spring:message code="label.fin_available_fnp_codes" /></label>
		     	</td>
		     	<td>
		     		   <label class="label-search"><spring:message code="label.fin_sel_fin_codes" /></label>
		     	</td>
	     	</tr>
	     	  	 <tr >
		     		<td colspan="1">
     		          <div class="t_form-left1">
			         	<table>
			         		<tr>
			         			<td>
			         				<button id="AddButton" name="AddButton" type="submit" class="button_small" ><spring:message code="button.add" /></button>
			         			</td>
			         		</tr>
			         		<tr>
			         			<td>
			         				<form:select size="10" cssStyle="menu_list"  id="fnpAddCatalogCode"  path="fnpAddCatalogCode" items="${catalogList}" itemLabel="descEng" itemValue="code" multiple="false" />
			         			</td>
			         		</tr>	
			         	</table>
       	
      					 </div>
		     		</td>
		     		<td>
		     			<div class="t_form-right1">
				         	<table>
					         		<tr>
					         			<td>
					         				<button name="RemoveButton" type="submit"" id="RemoveButton" class="button_small" ><spring:message code="button.remove" /></button>
					         			</td>
					         		</tr>
					         		<tr>
					         			<td>
					         				<form:select size="10"  cssStyle="menu_list" id="fnpRemoveCatalogCode"  path="fnpRemoveCatalogCode" items="${FinanceServicesInfo.selectedCatalogs}" itemLabel="descEng" itemValue="code" multiple="false" />
					         			</td>
					         		</tr>
					         </table>
				        
				        </div>
					</td>
	     	</tr>
	     	<tr>
	     		<td colspan="2">
	     			 <button name="ConfirmButton" id="ConfirmButton" type="submit" class="button_small" ><spring:message code="button.confirm" /></button>
	     		</td>
	     	</tr>
	     	<tr >
	     		<td colspan="2">
	     			<c:choose>
					<c:when	test='${FinanceServicesInfo.displayParam == "NO"}'>
					</c:when>
					<c:otherwise>
							 <c:choose>
							<c:when	test='${FinanceServicesInfo.displayParam == "YES"}'>
								<div>
						         <spring:message code="label.fin_sel_params" />
						           <br/>
						      	<table border="4" bordercolor="#FFF">
						       	  <c:forEach var="param" items="${FinanceServicesInfo.fnpParams}" varStatus="rowCounter">
							        <tr style="width: 100%;">
							          <td>
							          		 <form:select path="paramName" items="${FinanceServicesInfo.fnpParams}" itemLabel="name" itemValue="name"  />
							          </td>
							          <td>
							          	  <form:select path="mapping" items="${FinanceServicesInfo.fnpDefaultParamsVOs}" itemLabel="fdpValue" itemValue="fdpValue" >
						        		</form:select>
							          </td>
							           <td id="test">
							          	  <form:input id="testbox"  path="staticValue" />
							          </td>
							        </tr>
						      </c:forEach>
						      </table>
						      <br/><br/>
						         <button name="SaveButton" type="submit" id="SaveButton" class="button_small" ><spring:message code="button.save" /></button>
	         					</div>
	         					</c:when>
	         					<c:otherwise>
	         							<div>
	         							<spring:message code="label.fin_no_params" />
	         							   <br/><br/>
								         <button name="SaveButton1" id="SaveButton1" type="submit" class="button_small" ><spring:message code="button.save" /></button>
			         					</div>
	         					</c:otherwise>
	         					</c:choose>
					</c:otherwise>
				</c:choose>
	     		</td>
	     	</tr>
	     </table>

 	<input type="hidden" id="testAdd" name="testAdd" value="false" />
 	<input type="hidden" id="testRemove" name="testRemove" value="false" />
 </form:form>
 </div>


 <script>
 function submitForm(){
	 $('#FinanceServicesFrm').submit();
 }
 </script>
 
